﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace RVO3D
{
    public static class Math
    {
        public const float RVO3D_EPSILON = 0.00001f;
        public const int RVO3D_MAX_LEAF_SIZE = 10;
        public const int RVO3D_ERROR = int.MaxValue;

        /// <summary>
        /// 计算平方
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static float Square(float value)
        {
            return value * value;
        }

        /// <summary>
        /// 交换a和b的引用
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="a"></param>
        /// <param name="b"></param>
        public static void Swap<T>(ref T a, ref T b)
        {
            T temp = a;
            a = b;
            b = temp;
        }

    }
}

